<?php

/**
 * BolaoTournament form.
 *
 * @package    bolao-aabb
 * @subpackage form
 * @author     Your name here
 */
class BolaoTournamentForm extends BaseBolaoTournamentForm
{
  public function configure()
  {
    $this->widgetSchema['creator_id'] = new sfWidgetFormInputHidden();

    $this->widgetSchema['name'] = new sfWidgetFormInputText(array(
      'label' => 'Nome'
    ), array(
      'class' => 'large'
    ));

    $this->widgetSchema['start_date'] = new sfWidgetFormJQueryDate(array(
      'label' => 'Data de in&iacute;cio',
      'date_widget' => new sfWidgetFormDate(array('format' => '%day%/%month%/%year%')),
      'image' => '/images/calendar.jpg',
      'culture' => 'pt-BR'
    ));

    $this->widgetSchema['subcategory_id']->setLabel('Subcategoria');

    $this->widgetSchema['scoresheet'] = new sfWidgetFormInputFile(array(
      'label' => 'Arquivo',
    ));
    $this->validatorSchema['scoresheet'] = new sfValidatorFile(array(
      'required'   => false,
      'path'       => sfConfig::get('sf_upload_dir').'/tournaments',
    ));

    $this->widgetSchema['send_email'] = new sfWidgetFormInputCheckbox(array(
      'label' => 'Enviar e-mail?'
    ));
    $this->validatorSchema['send_email'] = new sfValidatorBoolean();
  }
}
